class Solution {
public:
    int countKeyChanges(string s) {
        for (int i = 0; i < s.size(); i++) {
            if (s[i] >= 'A' && s[i] <= 'Z') {
                s[i] += 32;
            }
        }
        int cnt = 0;
        for (int i = 1; i < s.size(); i++) {
            cnt += (s[i] != s[i - 1]);
        }
        return cnt;
    }
};
